<?php

class Core_Frontend_Module_Concessions_Content extends Dcmp_Module_Base {

    protected $name = 'concessions_content';
    
    public function install() {

    }

    public function uninstall() {

    }

    public function buildConfig($form) {
        $form->addTextBoxField($this->__('promotion.label.concessions_id'), 'concessions_id', 'module[parameters][concessions_id]',TRUE);
        $form->createTab('dynamic_option', $this->__('design.label.dynamic_parameter'),
                array('field_concessions_id'));
    }

    public function render() {
        $concessions = $this->getVariables()->getData('concessions_object');
        if(!$concessions){
            $id = $this->getDynamicParameter('id');
            if(!$id){$id = 1;}
            $concessions = App::getModel('promotion/concessions')->load($id);
        }
        $customers = $concessions ->getCustomers()->limit(2,0)->load();
        $tmpl = $this->getTemplate()->assignMulti(array('concessions' => $concessions,'customers'=>$customers));
        return $tmpl->render($this->getTemplatePath($this->getValueByKey('template_name'),$this->getValueByKey('template_script')));
    }

}

